home *** CD-ROM | disk | FTP | other *** search
- * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
- * The C++ Answer Book */
- * Tony Hansen */
- * All rights reserved. */
- / write out num objects of the given
- / size from the named buffer
- nt fwrite(void *vbuf, unsigned int size,
- unsigned int num, FILE *f)
-
- char *buf = (char*)vbuf;
- if (f->mode != input)
- {
- // read in num * size bytes
- for (unsigned int n = num; n-- > 0; )
- for (unsigned int s = size; s-- > 0; )
- if (!f->out->put(*buf++))
- // The end of the output
- // partway through an object.
- // Return the number of complete
- // objects written so far.
- return num - n;
-
- // Return the number of
- // complete objects written
- return num - n;
- }
-
- return 0;
-
-